package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcCircleDiscuss;
import com.visizen.wisdomclass.server.model.WcCircleDiscussExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcCircleDiscussMapper {
    @SelectProvider(type=WcCircleDiscussSqlProvider.class, method="countByExample")
    int countByExample(WcCircleDiscussExample example);

    @DeleteProvider(type=WcCircleDiscussSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcCircleDiscussExample example);

    @Delete({
        "delete from wc_circle_discuss",
        "where DISCUSS_ID = #{DISCUSS_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long DISCUSS_ID);

    @Insert({
        "insert into wc_circle_discuss (DISCUSS_ID, CIRCLE_ID, ",
        "USER_ID, TIME, ",
        "CONTANT, TO_USER)",
        "values (#{DISCUSS_ID,jdbcType=BIGINT}, #{CIRCLE_ID,jdbcType=BIGINT}, ",
        "#{USER_ID,jdbcType=BIGINT}, #{TIME,jdbcType=TIMESTAMP}, ",
        "#{CONTANT,jdbcType=VARCHAR}, #{TO_USER,jdbcType=BIGINT})"
    })
    int insert(WcCircleDiscuss record);

    @InsertProvider(type=WcCircleDiscussSqlProvider.class, method="insertSelective")
    int insertSelective(WcCircleDiscuss record);

    @SelectProvider(type=WcCircleDiscussSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="DISCUSS_ID", property="DISCUSS_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CIRCLE_ID", property="CIRCLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TIME", property="TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CONTANT", property="CONTANT", jdbcType=JdbcType.VARCHAR),
        @Result(column="TO_USER", property="TO_USER", jdbcType=JdbcType.BIGINT)
    })
    List<WcCircleDiscuss> selectByExample(WcCircleDiscussExample example);

    @Select({
        "select",
        "DISCUSS_ID, CIRCLE_ID, USER_ID, TIME, CONTANT, TO_USER",
        "from wc_circle_discuss",
        "where DISCUSS_ID = #{DISCUSS_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="DISCUSS_ID", property="DISCUSS_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="CIRCLE_ID", property="CIRCLE_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT),
        @Result(column="TIME", property="TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="CONTANT", property="CONTANT", jdbcType=JdbcType.VARCHAR),
        @Result(column="TO_USER", property="TO_USER", jdbcType=JdbcType.BIGINT)
    })
    WcCircleDiscuss selectByPrimaryKey(Long DISCUSS_ID);

    @UpdateProvider(type=WcCircleDiscussSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcCircleDiscuss record, @Param("example") WcCircleDiscussExample example);

    @UpdateProvider(type=WcCircleDiscussSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcCircleDiscuss record, @Param("example") WcCircleDiscussExample example);

    @UpdateProvider(type=WcCircleDiscussSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcCircleDiscuss record);

    @Update({
        "update wc_circle_discuss",
        "set CIRCLE_ID = #{CIRCLE_ID,jdbcType=BIGINT},",
          "USER_ID = #{USER_ID,jdbcType=BIGINT},",
          "TIME = #{TIME,jdbcType=TIMESTAMP},",
          "CONTANT = #{CONTANT,jdbcType=VARCHAR},",
          "TO_USER = #{TO_USER,jdbcType=BIGINT}",
        "where DISCUSS_ID = #{DISCUSS_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcCircleDiscuss record);
}